//    Copyright (C) Kherty.  All rights reserved.
using System.Windows;

namespace OpenLS.Chart.UI
{
    class StrictConverter 
    {
        public static T Convert<T>(object o) where T : class
        {
            if (o == DependencyProperty.UnsetValue)
                return null;
            return (T)o;
        }
        public static T? ValueConvert<T>(object o) where T : struct
        {
            if (o == DependencyProperty.UnsetValue)
                return null;
            return (T)o;
        }
        public static T Convert<T>(object o, T defaultValue)
        {
            if (o == DependencyProperty.UnsetValue)
                return defaultValue;
            return (T)o;
        }
    }
}
